<template>
  <div class="qyxx_box">
    <div class="qyxx">
      <div class="head_clos">
        <h2>价格权限设置</h2>
        <span>
          <a-icon class="close" @click="close" type="close" />
        </span>
      </div>
      <div class="qyxx_inp">
        <ul>
          
          <li>
            <span class="inp_tit">可查看价格：</span>
            <div class="clearfix">
              <a-radio-group @change="vipdjChange" v-model="pricetype">

                <a-radio value="WLTEJIA">
                 网络特价
                </a-radio>
                <a-radio value="WLLSJ" >
                 价格1
                </a-radio>

                <a-radio value="WLPFJ">
                  价格2
                </a-radio>
                <a-radio value="WLZDJ">
                  价格3
                </a-radio>
                <a-radio value="paijia">
                  牌价
                </a-radio>
              </a-radio-group>
             
            </div>
            
          </li>
         
          <li>
            <span class="inp_tit">价格折扣：</span>
            <a-input-number :min="1" :max="999999" v-model="zkvalue"  />%
          </li>
           <!-- <li>
            <span class="inp_tit">价格含税：</span>
            <a-radio-group @change="jghsChange" v-model="price_type">
                <a-radio value="不含税">不含税</a-radio>
              <a-radio value="含税" aria-checked="1">含税</a-radio>
            
            </a-radio-group>
          </li> -->
          <li>
            <span class="inp_tit">价格查看权限：</span>
            <a-radio-group @change="jgckChange" v-model="jgckvalue">
                <a-radio value="否">否</a-radio>
              <a-radio value="是" aria-checked="1">是</a-radio>
            
            </a-radio-group>
          </li>
          
          <li class="foot_btn">
            <a-button type="primary" @click="adddjsub">确认提交</a-button>
            <a-button @click="close">取消</a-button>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import qs from "qs";



export default {
  data() {
    return { 
      pricetype: this.$parent.hydjlist.pricetype,
      zkvalue: this.$parent.hydjlist.priceDiscount,
      jgckvalue:this.$parent.hydjlist.priceView,
      price_type: this.$parent.hydjlist.is_tax
    };
  },
  components: {},
  methods: {
    //------结束 上传产品图
   
    //---------一系列change-------------------------
    vipdjChange(e) {
     
     this.pricetype=e.target.value;
    },
   
  
    jgckChange(e) {
       this.jgckvalue=e.target.value;
    },
      jghsChange(e) {
       this.price_type=e.target.value;
    },
    adddjsub() {
     
          //修改
           this.axios
          .post(
            "huiyuan/memberPriceEdit.php",
            qs.stringify({
              id_num:this.$parent.hydjlist.id_num,
              priceDiscount: this.zkvalue,
              priceView: this.jgckvalue,
              pricetype:this.pricetype,
              is_tax:this.price_type
            })
          )
          .then(res => {
            console.log('ssssssss',res);
            if (res.data.code == 303) {
              this.$notification["success"]({
                message: "成功",
                description: res.data.msg
              });
              this.$parent.handleChangelist(this.$parent.pagination)
              this.close()
            } else {
              this.$notification["error"]({
                message: "失败",
                description: res.data.msg
              });
            }
          });
      
      
    },
    //------------一系列change----------------------
    close() {
      this.$parent.pricexg = false;
    }
  },

  created() {
   
  }
};
</script>

<style lang='less' scoped>
.qyxx_box {
  .qyxx {
    width: 66%;
    height: auto;
    box-shadow: 0px 0px 7px #ccc;
    background-color: #fff;
    margin: 9px auto;
    position: relative;
    top: 63px;
    text-align: left;
    padding: 20px;
    .head_clos {
      display: flex;
      justify-content: space-between;
      .close {
        font-size: 20px;
      }
    }
    .qyxx_inp {
      ul {
        li {
          margin: 20px 0;
          .inp_tit {
            display: inline-block;
            width: 100px;
            text-align: right;
          }

          
          }
       
         
        }
        .foot_btn {
          width: 60%;
          text-align: center;
          button {
            margin: 0 20px;
          }
        }
      }
    }
  }

</style>
